package p270jp.pxv.android.model;

import android.content.Context;
import java.util.ArrayList;
import p270jp.pxv.android.legacy.constant.SearchTarget;
import p325m0.MutabilityOwnership;

/* compiled from: SearchTargetListConverter.kt */
/* renamed from: jp.pxv.android.model.SearchTargetListConverter */
/* loaded from: classes2.dex */
public final class SearchTargetListConverter {
    public static final int $stable = 8;
    private final Context context;
    private final SearchTarget[] searchTargets;

    public SearchTargetListConverter(Context context, SearchTarget[] searchTargetArr) {
        MutabilityOwnership.m3745m(context, "context");
        MutabilityOwnership.m3745m(searchTargetArr, "searchTargets");
        this.context = context;
        this.searchTargets = searchTargetArr;
    }

    public final ArrayList<SingleChoiceListValue> createSingleChoiceListValues() {
        ArrayList<SingleChoiceListValue> arrayList = new ArrayList<>();
        int length = this.searchTargets.length - 1;
        if (length >= 0) {
            int i = 0;
            while (true) {
                int i2 = i + 1;
                arrayList.add(new SingleChoiceListValue(i, this.searchTargets[i].getTitle(this.context)));
                if (i2 > length) {
                    break;
                }
                i = i2;
            }
        }
        return arrayList;
    }

    public final int getIndex(SearchTarget searchTarget) {
        MutabilityOwnership.m3745m(searchTarget, "searchTarget");
        int length = this.searchTargets.length - 1;
        if (length >= 0) {
            int i = 0;
            while (true) {
                int i2 = i + 1;
                if (this.searchTargets[i] != searchTarget) {
                    if (i2 > length) {
                        break;
                    }
                    i = i2;
                } else {
                    return i;
                }
            }
        }
        throw new IllegalArgumentException();
    }

    public final SearchTarget getItem(int i) {
        return this.searchTargets[i];
    }
}
